package cn.bugio.task05;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class Client {

    public static void main(String[] args) throws Throwable {
        IGamePlayer iGamePlayer = new GamePlayer();
        InvocationHandler handler = new GamePlayIH(iGamePlayer);
        System.out.println("开始的时间是：2021-10-6 10:04");
        ClassLoader cl = iGamePlayer.getClass().getClassLoader();
        IGamePlayer proxy = (IGamePlayer) Proxy.newProxyInstance(cl, new Class[]{IGamePlayer.class}, handler);
        proxy.login("玩家", "123456");
        proxy.killBoss();
        proxy.upgrade();
        System.out.println("结束时间是 2021-10-6 18:40");
    }
}
